package com.hotel.servlet;

/**
 * @author Eumenides.
 * @create 2021-05-12 16:31
 */

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(name = "ExitServlet", value = "/ExitServlet")
public class ExitServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.getSession().setAttribute("curUser", null);
        request.getSession().setAttribute("account", null);
        request.getSession().setAttribute("order", null);
        request.getSession().setAttribute("hotel",null);
        request.getSession().setAttribute("pageUpURI",null);
        request.getRequestDispatcher("index.jsp").forward(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    }
}
